import request from '@/utils/request'

const api_name = '/admin/show/carousel-info'
export default {
  getPageList(page, limit, searchObj) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  //宣传图上架
  publish(id, status) {
    return request({
      url: `${api_name}/publish/${id}/${status}`,
      method: 'get'
    })
  },

  removeById(id) {
    return request({
      url: `${api_name}/remove/${id}`,
      method: 'delete'
    })
  },
  save(carouselInfo) {
    return request({
      url: `${api_name}/save`,
      method: 'post',
      data: carouselInfo
    })
  },
  //编辑
  getById(id) {
    return request({
      url: `${api_name}/get/${id}`,
      method: 'get'
    })
  },

  //更新
  updateById(carouselInfo) {
    return request({
      url: `${api_name}/update`,
      method: 'put',
      data: carouselInfo
    })
  },
  batchRemove(idList) {
    return request({
      url: `${api_name}/batchRemove`,
      method: `delete`,
      data: idList
    })
  }
}
